﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;
using Skynet.BusinessEntities;
using System.ServiceModel.Activation;

namespace Skynet.BusinessLogic.BusinessComponents
{
    public enum ExamByCustomerSearchOptions
    {
        GetByCustomerId,
        GetByExamByCustomerId,
        RuntimeByCustomerId,
        RuntimeActiveByCustomerId,
        RuntimeByCustomerExamId,
        RuntimeRunningByCustomerId,
        RuntimeCompleteByCustomerId
    }
    public enum ExamSearchOptions
    {
        GetAll,
        GetByCustomerId,
        GetByCustomerIdCategoryId,
        GetDesignByCustomerIdCategoryId,
        GetOne
    }
    public enum ExamCategorySearchOptions
    {
        GetAll,
        GetOne
    }
    public enum QuestionIdSearchOptions
    {
        GetRandomByExamByCustomerId
    }
    public enum QuestionSearchOptions
    {
        GetOne,
        DesignOneWithAlternatives,
        DesignViewWithAlternativesByExamId,
        FullGetOneWithAlternatives,
        RuntimeByCustomerExamId,
        GetAll
    }
    public enum LoadQuestionOptions
    {
        LoadRuntimeQuestion,
        LoadDesignAlternatives,
        LoadRuntimeAlternatives
    }
    public enum LoadAlternativeOptions
    {
        LoadDesignAlternative,
        LoadCustomerAnswer
    }
    public enum MaintenanceQuestionsOptions
    {
        CUD,
        UReview
    }
    public enum MaintenanceAlternativeOptions
    {
        CUD,
        UCustomerAnswer

    }

    public enum FindExamByCustomerOptions
    {
        ActiveExams,
        RunningExams,
        CompleteExams

    }
    public enum SearchAlternativesOptions
    {
        DesignOne,
        DesignListByQuestionId
    }

    public enum QueryExamOptions
    {
        DesignListView
    }

    public enum SearchExamCategoriesOptions
    {
        GetAll,
        GetOne
    }
    public enum QueryExamCategoriesOptions
    {
        GetAllView,
        MaintenanceView
    }
    public enum QueryQuestionsOptions
    {
        DesignByExamView
    }
    public enum QueryAlternativesOptions
    {
        DesignByQuestion
    }
    [ServiceContract(Namespace="http://www.owlvey.net/Services/")]        
    public interface IBCExamQueries
    {

        [OperationContract]
        IEnumerable<ExamCategory> SearchExamCategories(SearchExamCategoriesOptions options = SearchExamCategoriesOptions.GetAll, Guid? Id = null);

        [OperationContract]
        string QueryExamCategories(QueryExamCategoriesOptions options, Guid? CustomerId = null);

        [OperationContract]
        IEnumerable<Exam> SearchExams(ExamSearchOptions options = ExamSearchOptions.GetAll, Guid? id = null, Guid? CustomerId = null, Guid? CategoryId = null);

        [OperationContract]
        string QueryExams(QueryExamOptions Options = QueryExamOptions.DesignListView, Guid? CategoryId = null, Guid? CustomerId = null);


        [OperationContract]
        IEnumerable<ExamByCustomer> SearchExamByCustomer(ExamByCustomerSearchOptions options = ExamByCustomerSearchOptions.GetByCustomerId, Guid? CustomerId = null, Guid? ExamByCustomerId = null);

        [OperationContract]
        IEnumerable<BaseAlternative> SearchAlternatives(SearchAlternativesOptions options = SearchAlternativesOptions.DesignOne, Guid? AlternativeId = null, Guid? QuestionId = null);

        [OperationContract]
        string QueryAlternatives(QueryAlternativesOptions options = QueryAlternativesOptions.DesignByQuestion, Guid? QuestionId = null);

        [OperationContract]
        IEnumerable<BaseQuestion> SearchQuestion(QuestionSearchOptions options = QuestionSearchOptions.GetAll, Guid? QuestionId = null, Guid? CustomerExamId = null, Guid? ExamId = null);

        [OperationContract]
        string QueryQuestions(QueryQuestionsOptions options = QueryQuestionsOptions.DesignByExamView, Guid? ExamId = null);

        [OperationContract]
        double FindExamByCustomer(FindExamByCustomerOptions options = FindExamByCustomerOptions.ActiveExams, Guid? CustomerId = null);
        
        [OperationContract]
        string ValidationSystem();

        [OperationContract()]
        void LoadQuestion(LoadQuestionOptions options, ref BaseQuestion Question);

        [OperationContract()]
        void LoadAlternative(LoadAlternativeOptions options, ref BaseAlternative Alternative);
    }
}
